# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libselinux
pkgver=3.3
pkgrel=1
pkgdesc="SELinux library and simple utilities"
url="https://github.com/SELinuxProject/selinux/wiki"
arch="all"
license="Public-Domain"
# we need coreutils for ln --relative
makedepends="pcre-dev linux-headers libsepol-dev fts-dev coreutils"
subpackages="$pkgname-dev $pkgname-doc $pkgname-utils"
source="https://github.com/SELinuxProject/selinux/releases/download/$pkgver/libselinux-$pkgver.tar.gz
	"

if [ "$CARCH" = "riscv64" ]; then
	options="textrels"
fi

build() {
	make FTS_LDLIBS="-lfts"
}

package() {
	make DESTDIR="$pkgdir" install
}

utils() {
	pkgdesc="SELinux libselinux utilies"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/sbin "$subpkgdir"/usr/
}

sha512sums="
9a89c05ea4b17453168a985ece93ba6d6c4127916e657c46d4135eb59a1f6408faa0802cc2e49187defbde5247d659037beee089877affbab3eab6af3433696c  libselinux-3.3.tar.gz
"
